#ifndef PAGE_CACHE_HH
#define PAGE_CACHE_HH

#include "Common.h"

class PageCache
{
public:
    static PageCache &getInstance();
    Span *newSpan(size_t nPage);
    mutex &getMtx();

    Span *pageIdSpanMap(void *obj);
    void dealloc(Span *span);

private:
    SpanList _pageSpanList[NPAGES];
    static PageCache _inst;
    mutex _mtx;
    unordered_map<PAGE_ID, Span *> _pageIdSpanMap;
};

#endif